package com.relytosoft.mizar.analyze.algorithm.base.config;

import com.relytosoft.mizar.analyze.base.constant.MediaCommonConstants;
import com.relytosoft.mizar.analyze.common.config.properties.MizarAnalyzeProperties;
import feign.RequestInterceptor;
import feign.RequestTemplate;

import javax.annotation.Resource;

/**
 * BitmanFeignInterceptor
 *
 * @Author SunLi
 * @Date: 2022/5/13 18:59
 * @Version 1.0
 */
public class BitmanFeignInterceptor implements RequestInterceptor {
    @Resource
    private MizarAnalyzeProperties analyzeProperties;

    @Override
    public void apply(RequestTemplate requestTemplate) {
        requestTemplate.header("content-type", MediaCommonConstants.JSON_HEADER);
        requestTemplate.query("AppKey", analyzeProperties.getAppkey());
        requestTemplate.query("SecretKey", analyzeProperties.getAppSecret());
    }
}
